<template>
  <div class="app">
    <h2 class="title">VUE路由测试</h2>
    <!-- 导航区 -->
     <div class="nav">
      <!-- to的两种写法
          1.字符串
          2.对象 -->
      <RouterLink to="/home" active-class="active">首页</RouterLink>
      <RouterLink :to="{name:'xinwen'}" active-class="active">新闻</RouterLink>
      <RouterLink :to="{path:'/about'}" active-class="active">关于</RouterLink>
     </div>
    <!-- 展示区 -->
     <div class="content">
      <RouterView></RouterView>
     </div>
  </div>
</template>

<script lang="ts" setup name="App">
 import { RouterView,RouterLink } from 'vue-router';

</script>

<style scoped>
  /* 基本样式重置 */
body, h2, a {
    margin: 0;
    padding: 0;
    text-decoration: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 容器样式 */
.app {
    max-width: 1200px;
    margin: 50px auto;
    padding: 40px;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* 标题样式 */
.title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 40px;
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* 导航栏样式 */
.nav {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.nav a {
    margin: 0 25px;
    color: #34495e;
    font-size: 18px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.active {
    background-color: #007BFF;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

/* 内容区样式 */
.content {
    padding: 40px;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    color: #333;
    font-size: 16px;
    line-height: 1.8;
    height: 400px;
}

</style>